//---------------------------------------------------------------------------
#ifndef CDBComboH
#define CDBComboH
//---------------------------------------------------------------------------
#include "CtrlDB.h"
#include <SysUtils.hpp>
#include <Controls.hpp>
#include <Classes.hpp>
#include <Forms.hpp>
#include <DBCtrls.hpp>
#include <StdCtrls.hpp>
//---------------------------------------------------------------------------
class PACKAGE_CTRLDB CDBComboBox : public TDBComboBox
{
private:
  AnsiString                m_asRefWebHelp;
  AnsiString                m_Libelle;
  bool                      m_Enabled;
  bool                      m_ReadOnly;
  int                       m_SizeEspace;
  TLabel                   *m_Label;
  TFont                    *m_LibelleFont;
  bool                      m_Obligatoire;
  TCorrectementRempliEvent  m_pfnOnEstCorrectementRempli;
  bool                      m_BleuSiHint;

  void __fastcall SetRefWebHelp(const AnsiString asValeur) { m_asRefWebHelp = asValeur;};
  void __fastcall SetEnabled     (bool       value);
  void __fastcall SetReadOnly    (bool       value);
  void __fastcall SetLibelleFont (TFont     *value);
  void __fastcall SetLibelle     (const AnsiString value);
  void __fastcall SetSizeEspace  (int        value);

  void __fastcall SetLibellePos(void);
  void __fastcall SetLibelleFontChange(TObject *Sender);
  void __fastcall SetObligatoire( bool bObligatoire);
  void __fastcall SetBleuSiHint( bool bBleuSiHint);

protected:
  void __fastcall WMWindowPosChanged(TWMWindowPosChanged &Msg);
  BEGIN_MESSAGE_MAP
   MESSAGE_HANDLER(WM_WINDOWPOSCHANGED, TWMWindowPosChanged, WMWindowPosChanged)
  END_MESSAGE_MAP(TDBComboBox)

  virtual void __fastcall WndProc( TMessage &Message);
  DYNAMIC void __fastcall Change(void);
  DYNAMIC void __fastcall KeyDown( Word &Key, TShiftState Shift); 

public:
  __fastcall CDBComboBox(TComponent* Owner);
  bool __fastcall EstCorrectementRempliDefault( void);
__published:
  __property AnsiString  RefWebHelp           = {read = m_asRefWebHelp, write = SetRefWebHelp };
  __property bool        Enabled      = { read=m_Enabled     , write=SetEnabled     , default=true  };
  __property AnsiString  Libelle      = { read=m_Libelle     , write=SetLibelle                     };
  __property TFont      *LibelleFont  = { read=m_LibelleFont , write=SetLibelleFont                 };
  __property bool        ReadOnly     = { read=m_ReadOnly    , write=SetReadOnly    , default=false };
  __property int         SizeEspace   = { read=m_SizeEspace  , write=SetSizeEspace  , default=10    };
  __property bool        Obligatoire  = { read=m_Obligatoire , write=SetObligatoire , default=false };
  __property TCorrectementRempliEvent OnEstCorrectementRempli = { read = m_pfnOnEstCorrectementRempli, write = m_pfnOnEstCorrectementRempli};
  __property bool        BleuSiHint   = { read=m_BleuSiHint  , write=SetBleuSiHint  , default=false };

};
//---------------------------------------------------------------------------
#endif
